package com.zhihaoliang.map

import android.app.Application
import coil.ImageLoader
import coil.ImageLoaderFactory
import com.zhihaoliang.map.util.UnsplashSizingInterceptor
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class CraneApplication : Application(), ImageLoaderFactory {

    /**
     * 创建加载 [imageLoader] 用于 [rememberImagePainter] 加载图片的 app
     */
    override fun newImageLoader(): ImageLoader {
        return ImageLoader.Builder(this).components { add(UnsplashSizingInterceptor) }.build()
    }
}